package com.sanpu.kxe.business.member.provider;

import android.content.Context;
import android.content.Intent;

import com.sanpu.kxe.business.member.contract.MemberConfig;
import com.sanpu.kxe.business.member.view.MemberCashierActivity;
import com.sanpu.kxe.business.member.view.MemberProductRateActivity;
import com.sanpu.kxe.business.member.view.MemberPromotListActivity;
import com.sanpu.kxe.business.member.view.MemberSpreadActivity;
import com.sanpu.kxe.utils.IntentTool;

/**
 * Description：会员模块内部provider
 * Created by 薛勇军 on 2018/7/30.
 */

public class MemberOpenProvider {

    private static MemberOpenProvider instance;

    public static MemberOpenProvider getInstance() {
        if (instance == null) {
            synchronized (MemberOpenProvider.class) {
                if (instance == null) {
                    instance = new MemberOpenProvider();
                }
            }
        }
        return instance;
    }

    /**
     * 新版充值会员支付页
     */
    public void openMemberCashierActivity(Context context, String realPrice, String title, String vipOpenId) {
        Intent intent = new Intent(context, MemberCashierActivity.class);
        intent.putExtra(MemberConfig.INTENT_MEMBER_PRICE, realPrice);
        intent.putExtra(MemberConfig.INTENT_MEMBER_TITLE, title);
        intent.putExtra(MemberConfig.INTENT_MEMBER_ID, vipOpenId);
        IntentTool.startActivity(context, intent);
    }

    /**
     * 会员推广列表
     */
    public void openMemberSpreadActivity(Context context) {
        IntentTool.startActivity(context, new Intent(context, MemberSpreadActivity.class));
    }

    /**
     * 我的用户列表
     */
    public void openMemberPromotListActivity(Context context, String merchantLevel) {
        Intent intent = new Intent(context, MemberPromotListActivity.class);
        intent.putExtra(MemberConfig.INTENT_MERCHANTLEVEL, merchantLevel);
        IntentTool.startActivity(context, intent);
    }

    /**
     * 产品费率
     */
    public void openMemberProductRateActivity(Context context) {
        Intent intent = new Intent(context, MemberProductRateActivity.class);
        IntentTool.startActivity(context, intent);
    }
}
